package com.tedsoft.first_group_project;

import java.util.Comparator;

public class Item 
{
	e_item_type type;
	int id;
	int posX, posY;	
	int width, height;
	int weight;
	
	public Item(e_item_type item_type,int item_id, int x, int y)
	{
		type = item_type;
		id = item_id; 
		posX = x;
		posY = y;
		
		//domyslna waga to itemka to 1
		weight = 1;
		
		if(type == e_item_type.enemy)
		{
			switch(id)
			{
				case 1:
					width = 23;
					height = 23;
					break;
					
				case 2:
					width = 16;
					height = 19;					
					break;
					
				case 3:
					width = 13;
					height = 8;					
					break;
					
				case 4:
					width = 12;
					height = 12;					
					break;
					
				case 5:
					width = 16;
					height = 31;					
					break;
					
				case 6:
					width = 9;
					height = 14;					
					break;
					
				case 7:
					width = 30;
					height = 30;					
					break;
					
				case 8:
					width = 28;
					height = 28;					
					break;
			}
			
		}
		else if(type == e_item_type.point)
		{
			switch(id)
			{
				case 1:
					width = 20;
					height = 29;
					weight = 10;
					break;
					
				case 2:
					width = 14;
					height = 29;
					weight = 15;
					break;
					
				case 3:
					width = 15;
					height = 27;
					weight = 35;
					break;
			}
		}
	}
}

class ItemComparatorPosX implements Comparator<Item> {
    public int compare(Item item1, Item item2) {
        return item1.posX - item2.posX;
    }
}

